/**
 * 订单列表
 */
export function apiOrderBasicList(params) {
	return uni.$u.http.get('order/orderBasic/list?' + params);
}
// 订单列表--根据订单状态筛选
export function orderList(data) {
  return uni.$u.http.post('/order/orderBasic/orderList', data, {
  	header: {
  		'content-type': 'application/json',
  	}
  });
}
/**
 * 员工列表
 */
export function geUserlist(params) {
	return uni.$u.http.get('order/orderBasic/geUserlist?' + params);
}
/*
 *  短租订单分配业务员 设置发车员/收车员
 */
export function distribution(params) {
	return uni.$u.http.put('/order/orderBasic/distribution', params, {
		header: {
			'content-type': 'application/json',
		}
	});
}
/**
 * 车辆列表
 */
export function geCarList(params) {
	return uni.$u.http.get('order/orderBasic/carListByMaintenancePc?' + params);
}


// 确定配车
export function supplyCar(params) {
	return uni.$u.http.put('/order/orderBasic/supplyCar', params, {
		header: {
			'content-type': 'application/json',
		}
	});
}
//车辆随车物品

export function car_accessories() {
	return uni.$u.http.get('/system/dict/data/type/car_accessories');
}

// 交车验车/还车验车
export function delivery(params) {
	return uni.$u.http.post('/order/orderBasic/delivery', params, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 还车验车收费项 https://www.showdoc.com.cn/1846525842933182/8611637332204534
export function alsoCarItems() {
	return uni.$u.http.get('/order/orderBasic/alsoCarItems');
}

// 短租订单费用明细 https://www.showdoc.com.cn/1846525842933182/8559520456211191
export function depositRefundDetail(orderNo) {
	return uni.$u.http.get('/order/orderBasic/depositRefundDetail/' + orderNo);
}
// 查询押金结算详细
export function getSettlement(id) {
	return uni.$u.http.get('/order/settlement/' + id);
}
// 新增押金结算
export function addSettlement(data) {
	return uni.$u.http.post('/order/settlement', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}
// 车损结算
export function vehicleDamage(data) {
	return uni.$u.http.post('/order/orderBasic/vehicleDamage', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 修改押金结算
export function updateSettlement(data) {
	return uni.$u.http.put('/order/settlement', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 删除押金结算
export function delSettlement(id) {
	return uni.$u.http.delete('/order/settlement/' + id);
}

// 完成租车押金结算单
// export function overDepositSettlement(orderNo) {
// 	return uni.$u.http.post('/order/orderBasic/overDepositSettlement/' + orderNo);
// }
export function IllegalProcessing(orderNo) {
	return uni.$u.http.get('/order/orderBasic/IllegalProcessing/' + orderNo);
}
// 完成违章押金结算单
export function OverIllegalDeposit(data) {
	return uni.$u.http.post('/order/orderBasic/OverIllegalDeposit', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 押金结算退款
export function depositRefund(orderNo,voucherId) {
	return uni.$u.http.post('/order/orderBasic/depositRefund/' + orderNo+'/'+voucherId)
}
// // 违章押金退款
// export function IllegalDepositRefund(orderNo,voucherId) {
// 	return uni.$u.http.post('/order/orderBasic/IllegalDepositRefund/' + orderNo+'/'+voucherId)
// }
// 支付凭证
export function addVoucher(data) {
	return uni.$u.http.post('/order/voucher', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}
// 短租订单详情 https://www.showdoc.com.cn/1846525842933182/8559520456211191
export function detail(orderNo) {
	return uni.$u.http.get('/order/orderBasic/' + orderNo);
}
// 短租订单详情 https://www.showdoc.com.cn/1846525842933182/8559520456211191
export function costDetail(orderNo) {
	return uni.$u.http.get('/order/orderBasic/costDetail/' + orderNo);
}

// 线下收款 收取租金
export function chargeRent(orderNo,voucherId) {
	return uni.$u.http.post('/order/orderBasic/chargeRent/' + orderNo+'/'+voucherId, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 线下收款 收取押金
export function chargeDeposit(orderNo,voucherId) {
	return uni.$u.http.post('/order/orderBasic/chargeDeposit/' + orderNo+'/'+voucherId, {
		header: {
			'content-type': 'application/json',
		}
	})
}


// 查询订单费用列表
export function getAllPaymentOfFees(orderNo) {
	return uni.$u.http.get('/order/orderBasic/getAllPaymentOfFees/' + orderNo);
}

// 费用缴纳-租金明细
export function rentDetail(orderNo) {
	return uni.$u.http.get('/order/orderBasic/rentDetail/' + orderNo);
}
// 车辆押金明细
export function depositDetail(orderNo) {
	return uni.$u.http.get('/order/orderBasic/depositDetail/' + orderNo);
}
// 违章押金明细
export function illegalDepositDetail(orderNo) {
	return uni.$u.http.get('/order/orderBasic/illegalDepositDetail/' + orderNo);
}
// 费用缴纳- 续租费用明细
export function renewalDetail(orderNo) {
	return uni.$u.http.get('/order/orderBasic/renewalDetail/' + orderNo);
}
//费用缴纳-还车产生费用
export function returnRecord(orderNo) {
	return uni.$u.http.get('/order/orderBasic/returnRecord/' + orderNo);
}
// 费用缴纳- 违章费用
export function violationRecord(orderNo) {
	return uni.$u.http.get('/order/orderBasic/violationRecord/' + orderNo);
}

// 费用缴纳
export function paymentOfFees(data) {
	return uni.$u.http.post('/order/orderBasic/paymentOfFees', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 同行列表
 */
export function secondedList(params) {
	return uni.$u.http.get('/seconded/job/list?' + params);
}

// 订单配车
export function seconded(data) {
	return uni.$u.http.post('/seconded/seconded', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 押金是否支付
 */
export function orderCostIspay(params) {
	return uni.$u.http.get('/order/orderBasic/orderCostIspay/' + params);
}

/**
 * 押金结算
 */
export function depositSettlementDetails(params) {
	return uni.$u.http.get('/order/orderBasic/depositSettlementDetails/' + params);
}

// 完成押金结算
export function overDepositSettlement(data) {
	return uni.$u.http.post('/order/orderBasic/overDepositSettlement', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 违章押金结算
 */
export function illegalDetail(params) {
	return uni.$u.http.get('/order/orderBasic/illegalDetail/' + params);
}

// 完成违章押金结算
export function IllegalDepositRefund(data) {
	return uni.$u.http.post('/order/orderBasic/IllegalDepositRefund/'+ data);
}

// 续租--选择时间查费用信息
export function renewalFee(data) {
	return uni.$u.http.post('/order/orderBasic/renewalFee', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 续租--提交数据
export function decisionOrderRenewal(data) {
	return uni.$u.http.post('/order/orderBasic/decisionOrderRenewal', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 提前还车扣款明细
export function earlyReturnDetail(data) {
	return uni.$u.http.post('/order/orderBasic/earlyReturnDetail', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 提前还车并退款
export function earlyReturn(data) {
	return uni.$u.http.post('/order/orderBasic/earlyReturn', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}


/**
 * 续租列表
 */
export function renewRecord(params) {
	return uni.$u.http.get('/order/orderBasic/renewRecords?' + params);
}

/**
 * 订单费用—租金
 */
export function orderRentDetail(params) {
	return uni.$u.http.get('/order/orderBasic/orderRentDetail/' + params);
}

/**
 * 订单详情-费用明细-车辆押金
 */
export function orderDepositDetail(params) {
	return uni.$u.http.get('/order/orderBasic/orderDepositDetail/' + params);
}

/**
 * 订单详情-费用明细-违章押金
 */
export function orderIllegalDetail(params) {
	return uni.$u.http.get('/order/orderBasic/orderIllegalDetail/' + params);
}

/**
 * 订单详情-费用明细-车损费用
 */
export function orderVehicleDetail(params) {
	return uni.$u.http.get('/order/orderBasic/orderVehicleDetail/' + params);
}

/**
 * 订单详情-费用明细-违章费用
 */
export function orderViolationDetail(params) {
	return uni.$u.http.get('/order/orderBasic/orderViolationDetail/' + params);
}

/**
 * 各状态订单数量
 */
export function orderCount(params) {
	return uni.$u.http.get('/order/orderBasic/orderCount');
}
/**
 * 订单收益
 */
export function revenueRankingApi(data) {
	return uni.$u.http.post('/workbench/revenueRankingApi', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}
/**
 * 待办事项统计
 */
export function workbenchgetOrderData(data) {
	return uni.$u.http.post('/workbench/getOrderData', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 短租订单取消明细
 */
export function cancelDetail(params) {
	return uni.$u.http.get('/order/orderBasic/cancelDetail/'+params);
}


// 短租订单取消
export function cancelAndRefund(data) {
	return uni.$u.http.post('/order/orderBasic/cancelAndRefund', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 新增费用
export function addNewExpenses(data) {
	return uni.$u.http.post('/order/orderBasic/addNewExpenses', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 订单费用明细
 */
export function costAdjustmentDetail(params) {
	return uni.$u.http.get('/order/orderBasic/costAdjustmentDetail/' + params);
}

//租金减免
export function costAdjustment(data) {
	return uni.$u.http.post('/order/orderBasic/costAdjustment', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}



/**
 * 查询已分配的业务员
 */
export function getSalesman(params) {
	return uni.$u.http.get('/order/orderBasic/getSalesman/?' + params);
}


//订单换车获取新车费用项
export function changeFee(data) {
	return uni.$u.http.post('/order/orderBasic/changeFee', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 换车
export function changeCar(data) {
	return uni.$u.http.post('/order/orderBasic/changeCar', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 订单续租编辑回显
 */
export function renewRecordInfo(params) {
	return uni.$u.http.get('/order/orderBasic/renewRecordInfo/' + params);
}

// 续租--编辑提交数据
export function renewRecordEdit(data) {
	return uni.$u.http.post('/order/orderBasic/renewRecordEdit', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 取消订单续租记录
 */
export function renewRecordDelete(orderNo, id) {
	return uni.$u.http.delete(`/order/orderBasic/renewRecordDelete/${orderNo}/${id}`);
}


// 添加订单备注
export function orderRemark(data) {
	return uni.$u.http.post('/order/orderBasic/orderRemark', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

/**
 * 订单详情获取合同信息
 */
export function orderContract(orderNo) {
	return uni.$u.http.get('/contractInstance/orderNo/' + orderNo);
}

// 更新合同状态
export function updateContractStatus(data) {
	return uni.$u.http.put('/contractInstance/status', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 生成合同
export function addContract(data) {
	return uni.$u.http.post('/contractInstance/generate', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 重新生成合同
export function resetContract(data) {
	return uni.$u.http.post('/contractInstance/regenerate', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 合同认证
export function certificationContract(contractId) {
	return uni.$u.http.post('/contractInstance/certification/' + contractId);
}


// 客户认证
export function memberCertification(memberNo) {
	return uni.$u.http.post('/member/basic/certification/' + memberNo);
}

// 查看租户是不是开启了电子合同
export function getContractConfig() {
	return uni.$u.http.get('/credit/illegalQueryPriceDetail');
}

// 续租验证
export function verificationContract(orderNo) {
	return uni.$u.http.get('/order/orderBasic/verificationContract/'+orderNo);
}


// 校验
export function validRntalTime(data) {
	return uni.$u.http.post('/order/orderBasic/validRntalTime', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 还车验车回显
export function getEscrowByOrderNo(orderNo) {
	return uni.$u.http.get('/car/custodyBilling/getByOrderNo/'+orderNo);
}


// ota订单费用补录
export function supplementaryExpenses(data) {
	return uni.$u.http.post('/order/orderBasic/supplementaryExpenses', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}

// 费用补录信息
export function getSupplementaryPaymentList(orderNo) {
	return uni.$u.http.get('/bills/financial/getSupplementaryPaymentList/'+orderNo);
}


//查询免费时长
export function getFreeHour() {
	return uni.$u.http.get('/order/orderBasic/getFreeHour/getFreeHour');
}
// 获取油量和里程数
export function car_oil(param) {
	return uni.$u.http.get('/car/basic/carCurrData?'+'id='+param);
}
/**
 * 发送车钥匙设备命令

 */
export function vehiclekeyCommand(data) {
	return uni.$u.http.post('/car/basic/sendCarKeysinstruction', data, {
		header: {
			'content-type': 'application/json',
		}
	});
}
/**
 * 获取当前车辆绑定设备数据
 */
export function getCarOilQuantity(params) {
	return uni.$u.http.get('/car/basic/getBindDeviceNo?'+'id='+params);
}

/**
 * 获取当前车辆定位信息
 */
export function getCarLoation(params) {
	return uni.$u.http.get('/car/basic/getDeviceNoInfo?'+'deviceNo='+params);
}
